home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 9 / 009.d81 / dos #23 < prev    next >
Text File  |  2022-08-26  |  1KB  |  75 lines

  1.  
  2.      DOS and DONT'S -- Part 23
  3.      =========================
  4.  
  5.           by Jimmy Weiler
  6.  
  7.  
  8.  
  9.  
  10.   Closing a RELative file is as
  11.  
  12. simple as closing any other kind of
  13.  
  14. file -- CLOSE <file number>.  In our
  15.  
  16. case, this would be: CLOSE 3.
  17.  
  18.   The 1541 disk drive has an area of
  19.  
  20. 'buffer memory' where it stores PRINT#
  21.  
  22. information until it has enough to
  23.  
  24. write onto the disk.  This usually
  25.  
  26. means that the last few things you
  27.  
  28. sent to your file are still sitting in
  29.  
  30. memory waiting to be written.  If your
  31.  
  32. program ends suddenly, you lose that
  33.  
  34. data.  The way to force the data onto
  35.  
  36. the disk is to CLOSE your file.
  37.  
  38.   When you close your file is up to
  39.  
  40. you.  Some programs CLOSE only when
  41.  
  42. the user selects the QUIT option --
  43.  
  44. this results in faster disk access,
  45.  
  46. but if the user STOPs or RESTOREs
  47.  
  48. during the program, something could
  49.  
  50. be lost.  Other programs CLOSE after
  51.  
  52. every PRINT# to disk.  This virtually
  53.  
  54. guarantees that no data will be lost,
  55.  
  56. but it takes extra time to CLOSE and
  57.  
  58. OPEN the file every transatction.
  59.  
  60. The scheme you use depends on what is
  61.  
  62. more costly to you - a little data
  63.  
  64. lost or slow disk access.
  65.  
  66.  
  67.   Next month you can look forward to
  68.  
  69. the READ and WRITE statements when
  70.  
  71. working with RELative files.
  72.  
  73.  
  74. ---------- End of Article ------------
  75.